-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: convert to ESM, use Aspect build rules #1307
Conversation
f5ed199
to
d7c021f
Compare
d7c021f
to
a41dad5
Compare
@ddelgrosso1 FYI - Ben suggested I add you for the ESM conversion commit (just this one). This is our GAPIC generator and it's going to be an ESM app from now on. The fact that it's built by Bazel greatly complicates things. |
a41dad5
to
ce55a94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple nits, I think there are some built in Node.js methods you could be using like mkdir
with the recursive flag.
if (name.service === serviceName && name.method === methodName) { | ||
exactMatch = config; | ||
for (const name of config.name) { | ||
if (name.service === serviceName && !name.method) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems kind of strange to me that this wouldn't be an if/else, because would it be possible for !name.method and name.method ==== methodName?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, if-else is more logical here. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for bazel stuff
This PR consists of four commits that are logically unrelated but should go together. It might be easier to review them one by one.
Update baselines (copyright year and minor changes of dependency protos). This one is straightforward.
Change the Bazel stack to use the new Aspect rules for JavaScript and TypeScript. Unfortunately, for TypeScript, I'm currently using my fork of the rules that fixes some issues; I'll try to contribute it upstream but I'm willing to use the fork while this is in progress to unblock this repository.
Make the generator an ESM module. It simplifies working with new dependencies, and make TypeScript emit more predictable code (compared with the one with commonjs requires).
Remove fragile parts that keep breaking. We are getting rid of
gts
andeslint
(for now, until they properly support the new ESM import syntax - I filed bring back gts and/or eslint #1308) and also getting rid of complicated integration tests: they were broken anyway but were reporting pass, which is the worst thing a test can do. I'll need to rethink how to make good integration tests. For now, we still have baseline test and we check that the generated libraries compile properly.R= @noahdietz for Bazel related fixes (this commit specifically)
R= @sofisl and @bcoe for ESM related fixes (this commit)